<template>
  <div class="surrender-post-container">
    <!-- 搜索和操作栏 -->
    <div class="search-container" style="display: flex; align-items: center; justify-content: space-between;">
      <div class="title">
        <h2>动物送养贴管理</h2>
      </div>

      <div style="display: flex; align-items: center; gap: 10px;">
        <el-input v-model="searchQuery.petName" placeholder="宠物名称" clearable style="width: 150px" />
        <el-input v-model="searchQuery.name" placeholder="送养人姓名" clearable style="width: 150px" />
        <el-select v-model="searchQuery.status" placeholder="审核状态" clearable style="width: 150px">
          <el-option label="待审核" value="pending" />
          <el-option label="已通过" value="approved" />
          <el-option label="已拒绝" value="rejected" />
          <el-option label="已完成" value="completed" />
        </el-select>
        <el-select v-model="searchQuery.petTypeName" placeholder="宠物类型" clearable style="width: 150px">
          <el-option v-for="type in petTypes" :key="type.id" :label="type.type" :value="type.id" />
        </el-select>
        <el-button type="primary" @click="handleSearch" class="search-btn">
          <el-icon>
            <Search />
          </el-icon>搜索
        </el-button>
        <el-button type="danger" @click="handleClear" class="clear-btn">
          <el-icon>
            <Delete />
          </el-icon>清除
        </el-button>
      </div>
    </div>

    <!-- 送养贴列表 -->
    <el-table v-loading="loading" :data="surrenderList" class="custom-table" border stripe>
      <el-table-column label="ID" prop="id" width="80" align="center" />
      <el-table-column label="宠物照片" width="120" align="center">
        <template #default="scope">
          <div class="pet-info">
            <el-image 
              :src="`/api/Petfile/${scope.row.pet_image}`"
              class="pet-image" 
              fit="cover"
              :preview-src-list="[`/api/Petfile/${scope.row.pet_image}`]"
              :hide-on-click-modal="false"
              preview-teleported
            >
              <template #error>
                <el-icon><Picture /></el-icon>
              </template>
            </el-image>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="宠物名称" prop="pet_name" min-width="120" align="center" />
      <el-table-column label="送养人"  min-width="120" align="center">
        <template #default="scope">
          <div class="user-info">
            <el-avatar :size="30" :src="`/api/Userfile/${scope.row.user_avatar}`">
              <el-icon><User /></el-icon>
            </el-avatar>
            <span>{{ scope.row.name }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="类型" prop="petTypeName" width="100" align="center">
        <template #default="scope">
          <el-tag type="warning" class="pet-type-tag">
            {{ scope.row.petTypeName }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="联系电话" prop="contact_phone" width="130" align="center" />
      <el-table-column label="状态" width="100" align="center">
        <template #default="scope">
          <el-tag :type="getStatusType(scope.row.status)">
            {{ getStatusText(scope.row.status) }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="申请时间" width="180" align="center">
        <template #default="scope">
          {{ formatDate(scope.row.created_at) }}
        </template>
      </el-table-column>
      <el-table-column label="操作" width="250" align="center" fixed="right">
        <template #default="scope">
          <div style="display: flex; justify-content: center; gap: 10px;">
            <el-button type="info" size="small" @click="handleView(scope.row)" class="view-btn">
              <el-icon>
                <View />
              </el-icon>详情
            </el-button>
            <el-button v-if="scope.row.status === 'pending'" type="success" size="small"
              @click="handleApprove(scope.row)" class="approve-btn">
              <el-icon>
                <Check />
              </el-icon>通过
            </el-button>
            <el-button v-if="scope.row.status === 'pending'" type="danger" size="small" @click="handleReject(scope.row)"
              class="reject-btn">
              <el-icon>
                <Close />
              </el-icon>拒绝
            </el-button>
            <el-button v-if="scope.row.status === 'approved'" type="primary" size="small"
              @click="handleComplete(scope.row)" class="complete-btn">
              <el-icon>
                <Check />
              </el-icon>完成
            </el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <div class="pagination">
      <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
        :page-sizes="[2, 5, 10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper" :total="total"
        @size-change="handleSizeChange" @current-change="handleCurrentChange" background />
    </div>

    <!-- 详情对话框 -->
    <el-dialog title="送养申请详情" v-model="detailDialogVisible" width="700px" :close-on-click-modal="false">
      <div class="detail-container" v-if="detailData.id">
        <div class="detail-header">
          <div class="status-tag">
            <el-tag :type="getStatusType(detailData.status)" size="large" effect="dark">
              {{ getStatusText(detailData.status) }}
            </el-tag>
          </div>
          <div class="application-id">
            申请编号: <span class="id-text">#{{ detailData.id }}</span>
          </div>
        </div>

        <!-- 送养人信息 -->
        <div class="detail-section">
          <h3>
            <el-icon><User /></el-icon>
            送养人信息
          </h3>
          <div class="detail-row">
            <div class="detail-item">
              <span class="item-label">姓名</span>
              <span class="item-value highlight">{{ detailData.name }}</span>
            </div>
            <div class="detail-item">
              <span class="item-label">联系电话</span>
              <span class="item-value highlight">{{ detailData.contact_phone }}</span>
            </div>
            <div class="detail-item">
              <span class="item-label">联系地址</span>
              <span class="item-value highlight">{{ detailData.contact_address }}</span>
            </div>
          </div>
        </div>

        <!-- 宠物信息 -->
        <div class="detail-section">
          <h3>
            <el-icon><Picture /></el-icon>
            宠物信息
          </h3>
          <div class="pet-section">
            <div class="pet-image-container">
              <el-image 
                :src="`/api/Petfile/${detailData.pet_image}`"
                class="detail-pet-image"
                fit="cover"
                :preview-src-list="[`/api/Petfile/${detailData.pet_image}`]"
                :hide-on-click-modal="false"
                preview-teleported
              >
                <template #error>
                  <el-icon><Picture /></el-icon>
                </template>
              </el-image>
            </div>
            <div class="pet-details">
              <h4 class="pet-name">{{ detailData.pet_name }}</h4>
              <div class="pet-info-grid">
                <div class="pet-info-item">
                  <span class="item-label">类型</span>
                  <span class="item-value highlight"><el-tag type="warning" effect="dark">{{ detailData.petTypeName }}</el-tag></span>
                </div>
                <div class="pet-info-item">
                  <span class="item-label">年龄</span>
                  <span class="item-value highlight"><el-tag type="warning" effect="dark">{{ detailData.pet_age }}岁</el-tag></span>
                </div>
                <div class="pet-info-item">
                  <span class="item-label">性别</span>
                  <span class="item-value highlight"><el-tag type="warning" effect="dark">{{ detailData.pet_gender === 'male' ? '公' : '母' }}</el-tag></span>
                </div>
                <div class="pet-info-item">
                  <span class="item-label">健康状况</span>
                  <span class="item-value highlight"><el-tag type="primary" effect="dark">{{ detailData.health_status }}</el-tag></span>
                </div>
                <div class="pet-info-item">
                  <span class="item-label">是否绝育</span>
                  <span class="item-value highlight"><el-tag type="primary" effect="dark">{{ detailData.is_sterilized ? '是' : '否' }}</el-tag></span>
                </div>
                <div class="pet-info-item">
                  <span class="item-label">是否接种疫苗</span>
                  <span class="item-value highlight"><el-tag type="primary" effect="dark">{{ detailData.is_vaccinated ? '是' : '否' }}</el-tag></span>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 送养原因 -->
        <div class="detail-section">
          <h3>
            <el-icon><InfoFilled /></el-icon>
            送养原因
          </h3>
          <div class="reason-content">
            {{ detailData.surrender_reason || '未提供送养原因' }}
          </div>
        </div>

        <!-- 宠物描述 -->
        <div class="detail-section">
          <h3>
            <el-icon><Document /></el-icon>
            宠物描述
          </h3>
          <div class="reason-content">
            {{ detailData.pet_description || '未提供宠物描述' }}
          </div>
        </div>

        <!-- 审核信息 -->
        <div class="detail-section" v-if="detailData.status !== 'pending'">
          <h3>
            <el-icon><Check /></el-icon>
            审核信息
          </h3>
          <div class="detail-row">
            <div class="detail-item full-width">
              <span class="item-label">审核结果</span>
              <span class="item-value">
                <el-tag :type="getStatusType(detailData.status)" effect="dark">
                  {{ getStatusText(detailData.status) }}
                </el-tag>
              </span>
            </div>
          </div>
          <div class="detail-row">
            <div class="detail-item full-width">
              <span class="item-label">审核备注</span>
              <div class="reason-content">
                {{ detailData.review_comment || '无审核备注' }}
              </div>
            </div>
          </div>
          <div class="detail-row">
            <div class="detail-item">
              <span class="item-label">审核时间</span>
              <span class="item-value highlight">{{ formatDate(detailData.review_time) }}</span>
            </div>
            <div class="detail-item">
              <span class="item-label">审核人员</span>
              <span class="item-value highlight">{{ detailData.reviewer_name || '系统' }}</span>
            </div>
          </div>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="detailDialogVisible = false" class="cancel-btn">关闭</el-button>
          <template v-if="detailData.status === 'pending'">
            <el-button type="success" @click="handleApproveInDialog" class="approve-btn">
              <el-icon>
                <Check />
              </el-icon>通过
            </el-button>
            <el-button type="danger" @click="handleRejectInDialog" class="reject-btn">
              <el-icon>
                <Close />
              </el-icon>拒绝
            </el-button>
          </template>
          <el-button v-if="detailData.status === 'approved'" type="primary" @click="handleCompleteInDialog"
            class="complete-btn">
            <el-icon>
              <Check />
              </el-icon>完成
          </el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 审核对话框 -->
    <el-dialog :title="reviewType === 'approve' ? '通过送养申请' : reviewType === 'reject' ? '拒绝送养申请' : '完成送养流程'"
      v-model="reviewDialogVisible" width="500px" :close-on-click-modal="false">
      <el-form ref="reviewFormRef" :model="reviewForm" :rules="reviewRules" label-width="80px">
        <el-form-item label="审核备注" prop="comment">
          <el-input v-model="reviewForm.comment" type="textarea" :rows="4" placeholder="请输入审核备注" />
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="reviewDialogVisible = false" class="cancel-btn">取消</el-button>
          <el-button :type="reviewType === 'approve' ? 'success' : reviewType === 'reject' ? 'danger' : 'primary'"
            @click="submitReview" class="submit-btn">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 完成对话框 -->
    <el-dialog title="完成送养流程" v-model="completeDialogVisible" width="500px" :close-on-click-modal="false">
      <el-form ref="completeFormRef" :model="completeForm" :rules="completeRules" label-width="100px">
        <el-form-item label="完成备注" prop="comment">
          <el-input v-model="completeForm.comment" type="textarea" :rows="4" placeholder="请输入完成备注" />
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="completeDialogVisible = false" class="cancel-btn">取消</el-button>
          <el-button type="primary" @click="submitComplete" class="submit-btn">确定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Delete, View, Check, Close, Picture, User, InfoFilled, Document } from '@element-plus/icons-vue'
import request from '@/utils/request'

const loading = ref(false)
const surrenderList = ref([])
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(0)
const petTypes = ref([])

// 搜索条件
const searchQuery = reactive({
  petName: '',
  name: '',
  status: '',
  petTypeName: ''
})

// 详情对话框
const detailDialogVisible = ref(false)
const detailData = ref({})

// 审核对话框
const reviewDialogVisible = ref(false)
const reviewType = ref('') // approve, reject, complete
const reviewForm = reactive({
  id: null,
  comment: '',
  status: '',
  pet_id: null,
  pet_image: '',
  pet_name: '',
  pet_type_id: null,
  pet_age: null,
  pet_gender: '',
  pet_description: '',
  adoption_requirements: ''
})
const reviewRules = {
  comment: [
    { required: true, message: '请输入审核备注', trigger: 'blur' }
  ]
}
const reviewFormRef = ref(null)

// 完成对话框
const completeDialogVisible = ref(false)
const completeForm = reactive({
  id: null,
  comment: ''
})
const completeRules = {
  comment: [
    { required: true, message: '请输入完成备注', trigger: 'blur' }
  ]
}
const completeFormRef = ref(null)

// 获取状态类型
const getStatusType = (status) => {
  switch (status) {
    case 'pending':
      return 'warning'
    case 'approved':
      return 'success'
    case 'rejected':
      return 'danger'
    case 'completed':
      return 'primary'
    default:
      return 'info'
  }
}

// 获取状态文本
const getStatusText = (status) => {
  switch (status) {
    case 'pending':
      return '待审核'
    case 'approved':
      return '已通过'
    case 'rejected':
      return '已拒绝'
    case 'completed':
      return '已完成'
    default:
      return '未知'
  }
}

// 格式化日期
const formatDate = (date) => {
  if (!date) return ''
  const d = new Date(date)
  const year = d.getFullYear()
  const month = String(d.getMonth() + 1).padStart(2, '0')
  const day = String(d.getDate()).padStart(2, '0')
  const hours = String(d.getHours()).padStart(2, '0')
  const minutes = String(d.getMinutes()).padStart(2, '0')
  const seconds = String(d.getSeconds()).padStart(2, '0')
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
}

// 获取宠物类型列表
const getPetTypes = async () => {
  try {
    const res = await request.get('/types/all')
    if (res.code === 200) {
      petTypes.value = res.data
    }
  } catch (error) {
    console.error('获取宠物类型失败:', error)
  }
}

// 获取送养记录列表
const getSurrenderList = async () => {
  loading.value = true
  try {
    const res = await request.get('/petSurrender/search', {
      params: {
        pageNum: currentPage.value,
        pageSize: pageSize.value,
        petName: searchQuery.petName,
        name: searchQuery.name,
        status: searchQuery.status,
        petTypeName: searchQuery.petTypeName
      }
    })
    if (res.code === 200 && res.data) {
      surrenderList.value = res.data.list
      total.value = res.data.total
      
      if (surrenderList.value.length === 0 && currentPage.value > 1) {
        currentPage.value--
        await getSurrenderList()
        return
      }
    } else {
      surrenderList.value = []
      total.value = 0
      ElMessage.warning('未找到相关数据')
    }
  } catch (error) {
    console.error('获取送养记录列表失败:', error)
    ElMessage.error('获取列表失败')
    surrenderList.value = []
    total.value = 0
  } finally {
    loading.value = false
  }
}

// 搜索
const handleSearch = () => {
  currentPage.value = 1
  getSurrenderList()
}

// 清除搜索条件
const handleClear = () => {
  Object.keys(searchQuery).forEach(key => {
    searchQuery[key] = ''
  })
  currentPage.value = 1
  getSurrenderList()
}

// 分页处理
const handleSizeChange = (val) => {
  pageSize.value = val
  currentPage.value = 1
  getSurrenderList()
}

const handleCurrentChange = (val) => {
  currentPage.value = val
  getSurrenderList()
}

// 查看详情
const handleView = (row) => {
  detailData.value = { ...row }
  detailDialogVisible.value = true
}

// 通过申请
const handleApprove = (row) => {
  reviewType.value = 'approve'
  reviewForm.id = row.id
  reviewForm.comment = ''
  reviewForm.status = 'approved'
  reviewForm.pet_id = row.id
  reviewForm.pet_image = row.pet_image
  reviewForm.pet_name = row.pet_name
  reviewForm.pet_type_id = row.pet_type_id
  reviewForm.pet_age = row.pet_age
  reviewForm.pet_gender = row.pet_gender
  reviewForm.pet_description = row.pet_description
  reviewForm.adoption_requirements = row.adoption_requirements
  reviewDialogVisible.value = true
}

// 拒绝申请
const handleReject = (row) => {
  reviewType.value = 'reject'
  reviewForm.id = row.id
  reviewForm.comment = ''
  reviewForm.status = 'rejected'
  reviewForm.pet_id = row.id
  reviewForm.pet_image = row.pet_image
  reviewForm.pet_name = row.pet_name
  reviewForm.pet_type_id = row.pet_type_id
  reviewForm.pet_age = row.pet_age
  reviewForm.pet_gender = row.pet_gender
  reviewForm.pet_description = row.pet_description
  reviewForm.adoption_requirements = row.adoption_requirements
  reviewDialogVisible.value = true
}

// 完成送养
const handleComplete = (row) => {
  reviewType.value = 'complete'
  reviewForm.id = row.id
  reviewForm.comment = ''
  reviewForm.status = 'completed'
  reviewForm.pet_id = row.id
  reviewForm.pet_image = row.pet_image
  reviewForm.pet_name = row.pet_name
  reviewForm.pet_type_id = row.pet_type_id
  reviewForm.pet_age = row.pet_age
  reviewForm.pet_gender = row.pet_gender
  reviewForm.pet_description = row.pet_description
  reviewForm.adoption_requirements = row.adoption_requirements
  reviewDialogVisible.value = true
}

// 在详情对话框中通过申请
const handleApproveInDialog = () => {
  handleApprove(detailData.value)
}

// 在详情对话框中拒绝申请
const handleRejectInDialog = () => {
  handleReject(detailData.value)
}

// 在详情对话框中完成送养
const handleCompleteInDialog = () => {
  handleComplete(detailData.value)
}

// 提交审核
const submitReview = async () => {
  try {
    const res = await request.post('/petSurrender/add', {
      id: reviewForm.id,
      status: reviewForm.status,
      review_comment: reviewForm.comment,
      pet_id: reviewForm.pet_id,
      pet_image: reviewForm.pet_image,
      pet_name: reviewForm.pet_name,
      pet_type_id: reviewForm.pet_type_id,
      pet_age: reviewForm.pet_age,
      pet_gender: reviewForm.pet_gender,
      pet_description: reviewForm.pet_description,
      adoption_requirements: reviewForm.adoption_requirements
    })
    
    if (res.code === 200) {
      ElMessage.success(
        reviewType.value === 'approve' ? '已通过申请' : 
        reviewType.value === 'reject' ? '已拒绝申请' : 
        '已完成送养'
      )
      reviewDialogVisible.value = false
      detailDialogVisible.value = false
      getSurrenderList()
    } else {
      ElMessage.error(res.msg || '操作失败')
    }
  } catch (error) {
    console.error('操作失败:', error)
    ElMessage.error('操作失败')
  }
}

// 提交完成
const submitComplete = () => {
  completeFormRef.value.validate(async (valid) => {
    if (valid) {
      try {
        const res = await request.post('/surrender/complete', {
          id: completeForm.id,
          comment: completeForm.comment
        })
        if (res.code === 200) {
          ElMessage.success('已完成送养流程')
          completeDialogVisible.value = false
          getSurrenderList()
          if (detailDialogVisible.value) {
            // 如果详情对话框打开，更新详情数据
            const updatedRow = surrenderList.value.find(item => item.id === completeForm.id)
            if (updatedRow) {
              detailData.value = { ...updatedRow }
            } else {
              // 重新获取详情
              getDetail(completeForm.id)
            }
          }
        } else {
          ElMessage.error(res.msg || '操作失败')
        }
      } catch (error) {
        console.error('操作失败:', error)
        ElMessage.error('操作失败')
      }
    }
  })
}

// 获取详情
const getDetail = async (id) => {
  try {
    const res = await request.get(`/surrender/detail/${id}`)
    if (res.code === 200) {
      detailData.value = res.data
    } else {
      ElMessage.error(res.msg || '获取详情失败')
    }
  } catch (error) {
    console.error('获取详情失败:', error)
    ElMessage.error('获取详情失败')
  }
}

onMounted(() => {
  getPetTypes()
  getSurrenderList()
})
</script>

<style scoped lang="scss">
.surrender-post-container {
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.search-container {
  margin-bottom: 20px;
}

.title h2 {
  margin: 0;
  font-size: 20px;
  color: #303133;
}

.search-btn {
  background-color: #f9dee1;
  border-color: #f9dee1;
  color: #2f3447;
}

.search-btn:hover {
  background-color: #f5c5cb;
  border-color: #f5c5cb;
}

.clear-btn {
  background-color: #ff4d4f;
  border-color: #ff4d4f;
}

.clear-btn:hover {
  background-color: #ff7875;
  border-color: #ff7875;
}

.custom-table {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pet-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pet-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.view-btn {
  background-color: #909399;
  border-color: #909399;
}

.view-btn:hover {
  background-color: #a6a9ad;
  border-color: #a6a9ad;
}

.approve-btn {
  background-color: #67c23a;
  border-color: #67c23a;
}

.approve-btn:hover {
  background-color: #85ce61;
  border-color: #85ce61;
}

.reject-btn {
  background-color: #f56c6c;
  border-color: #f56c6c;
}

.reject-btn:hover {
  background-color: #f78989;
  border-color: #f78989;
}

.complete-btn {
  background-color: #409eff;
  border-color: #409eff;
}

.complete-btn:hover {
  background-color: #66b1ff;
  border-color: #66b1ff;
}

.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

/* 详情对话框样式 */
.detail-container {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 12px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ebeef5;
}

.application-id {
  font-size: 15px;
  color: #606266;
  
  .id-text {
    font-weight: bold;
    color: #303133;
  }
}

.detail-section {
  margin-bottom: 30px;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);

  h3 {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;

    .el-icon {
      font-size: 20px;
      color: #409eff;
    }
  }
}

.detail-row {
  display: flex;
  margin-bottom: 20px;
  gap: 20px;
}

.detail-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.full-width {
  flex: 2;
}

.item-label {
  font-size: 14px;
  color: #909399;
}

.item-value {
  font-size: 15px;
  color: #606266;

  &.highlight {
    color: #303133;
    font-weight: 500;
  }
}

.pet-section {
  display: flex;
  gap: 30px;
}

.pet-image-container {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-pet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-details {
  flex: 1;
}

.pet-name {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #303133;
}

.pet-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.pet-info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.reason-content {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
  min-height: 80px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
}

.cancel-btn {
  background-color: #f9dee1;
  border-color: #f9dee1;
  color: #2f3447;
  &:focus {
    outline: none !important;
  }
}

.cancel-btn:hover {
  background-color: #f5c5cb;
  border-color: #f5c5cb;
}

.submit-btn {
  &:focus {
    outline: none !important;
  }
}

.pet-type-tag {
  font-size: 12px;
  font-weight: bold;
}
</style>
